From: Colin Walters Date: Wed, 14 Jun 2023 15:19:44 +0000 (-0400) Subject: pull: Add error prefixing for corrupt checksums X-Git-Tag: archive/raspbian/2023.7-3+rpi1~1^2~9^2~1^2~20^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=bae4347abeaa2a66d213758f790058f42cb71fd1;p=ostree.git pull: Add error prefixing for corrupt checksums I got a bug report with the bare error ``` error: Invalid checksum of length 0 expected 32 ``` And I'm pretty sure it's from here. Add error prefixing so we know exactly which metadata object was corrupt. --- diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 7c0598a8..0dd97664 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -734,11 +734,11 @@ scan_dirtree_object (OtPullData *pull_data, const char *checksum, const char *pa const guchar *tree_csum_bytes = ostree_checksum_bytes_peek_validate (tree_csum, error); if (tree_csum_bytes == NULL) - return FALSE; + return glnx_prefix_error (error, "Parsing dirtree %s tree child %s", checksum, dirname); const guchar *meta_csum_bytes = ostree_checksum_bytes_peek_validate (meta_csum, error); if (meta_csum_bytes == NULL) - return FALSE; + return glnx_prefix_error (error, "Parsing dirtree %s meta child %s", checksum, dirname); g_autofree char *subpath = g_strconcat (path, dirname, "/", NULL); queue_scan_one_metadata_object_c (pull_data, tree_csum_bytes, OSTREE_OBJECT_TYPE_DIR_TREE,